{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Pandas\n",
    "\n",
    "Pandas是基于Numpy的专业数据分析工具，可以灵活高效的处理各种数据集，也是我们后期分析案例的神器。它提供了两种类型的数据结构，分别是DataFrame和Series，我们可以简单的把DataFrame理解为Excel里面的一张表，而Series就是表中的某一列，后面学习和用到的所有Pandas操作，都是基于这些表和列进行的操作。\n",
    "\n",
    "这里有一点需要强调，Pandas和Excel、SQL相比，只是调用和处理数据的方式变了，核心都是对源数据进行一系列的处理，在正式处理之前，更重要的是谋定而后动，明确分析的意义，理清分析思路之后再处理和分析数据，往往事半功倍。\n",
    "\n",
    "参考：\n",
    "官方文档 https://pandas.pydata.org/pandas-docs/stable/getting_started/index.html"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 创建、读取和存储\n",
    "\n",
    "在Pandas中我们想要构造一张表，第一步一定是先导入我们的库——import pandas as pd\n",
    "\n",
    "构造DataFrame最常用的方式是**字典+列表**，语句很简单，先是字典外括，然后依次打出每一列标题及其对应的列值（此处一定要用列表），这里列的顺序并不重要："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bob</th>\n",
       "      <th>Sue</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>I liked it.</td>\n",
       "      <td>Pretty good.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>It was awful.</td>\n",
       "      <td>Bland.</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Bob           Sue\n",
       "0    I liked it.  Pretty good.\n",
       "1  It was awful.        Bland."
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df1 = pd.DataFrame({'Yes': [50, 21], 'No': [131, 2]})\n",
    "df2 = pd.DataFrame({'Bob': ['I liked it.', 'It was awful.'], 'Sue': ['Pretty good.', 'Bland.']})\n",
    "df2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们使用pd.DataFrame构造函数来生成这些DataFrame对象。创建新对象的语法是初始化一个字典，其键是列名（本例中为Bob和Sue），其值是条目列表。 这是构建新DataFrame的标准方法，也是你最容易遇到的方法。\n",
    "\n",
    "字典列表的构造函数为列标签分配值，但只使用0（0,1,2,3，...）的递增计数作为行标签。 有时候这没关系，但我们经常会想要自己分配这些行标签。\n",
    "\n",
    "DataFrame中使用的行标签列表称为索引。 我们可以在构造函数中使用索引参数为其赋值：\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bob</th>\n",
       "      <th>Sue</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Product A</th>\n",
       "      <td>I liked it.</td>\n",
       "      <td>Pretty good.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Product B</th>\n",
       "      <td>It was awful.</td>\n",
       "      <td>Bland.</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     Bob           Sue\n",
       "Product A    I liked it.  Pretty good.\n",
       "Product B  It was awful.        Bland."
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame({'Bob': ['I liked it.', 'It was awful.'], \n",
    "              'Sue': ['Pretty good.', 'Bland.']},\n",
    "             index=['Product A', 'Product B'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "相比之下，Series是一系列数据值。 如果DataFrame是表，则Series是列表。 事实上，你可以创建一个Series只有一个列表："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1\n",
       "1    2\n",
       "2    3\n",
       "3    4\n",
       "4    5\n",
       "dtype: int64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = pd.Series([1, 2, 3, 4, 5])\n",
    "p"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Series本质上是DataFrame的单个列。 因此，你可以使用索引参数以与之前相同的方式为Series分配列值。 但是，Series没有列名，它只有一个总名称："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[30, 35, 40]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "k = pd.Series([30, 35, 40], index=['2015 Sales', '2016 Sales', '2017 Sales'], name='Product A')\n",
    "k.values.tolist()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Series和DataFrame密切相关。 将DataFrame视为实际上只是一堆Series**粘合在一起**是有帮助的。\n",
    "\n",
    "#### 读取数据\n",
    "\n",
    "能够手动创建DataFrame和Series非常方便。 但是，在大多数情况下，我们实际上不会手动创建自己的数据，我们将使用已经存在的数据。\n",
    "\n",
    "数据可以以多种不同的形式和格式存储。 到目前为止，其中最基本的是简单的**CSV文件**，以及**xls文件**。\n",
    "\n",
    "*你可以在本repo中下载课件中提到的文件，或者使用Github Desktop来下载所有的文件到本地（推荐）*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200724</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200723</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200722</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200721</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>732</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170707</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.43</td>\n",
       "      <td>11.22</td>\n",
       "      <td>11.28</td>\n",
       "      <td>11.43</td>\n",
       "      <td>-0.15</td>\n",
       "      <td>-1.3100</td>\n",
       "      <td>69776.46</td>\n",
       "      <td>78795.099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>733</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170706</td>\n",
       "      <td>11.49</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.43</td>\n",
       "      <td>11.53</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>-0.8700</td>\n",
       "      <td>51529.62</td>\n",
       "      <td>58924.662</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>734</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170705</td>\n",
       "      <td>11.52</td>\n",
       "      <td>11.65</td>\n",
       "      <td>11.47</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.56</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2600</td>\n",
       "      <td>50503.45</td>\n",
       "      <td>58339.668</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>735</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170704</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11.68</td>\n",
       "      <td>11.45</td>\n",
       "      <td>11.56</td>\n",
       "      <td>11.50</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5200</td>\n",
       "      <td>50820.01</td>\n",
       "      <td>58857.307</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>736</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170703</td>\n",
       "      <td>11.44</td>\n",
       "      <td>11.55</td>\n",
       "      <td>11.30</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11.44</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5200</td>\n",
       "      <td>41711.00</td>\n",
       "      <td>47616.602</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>737 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date   open   high    low  close  pre_close  change  \\\n",
       "0    002747.SZ    20200724  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "1    002747.SZ    20200723  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "2    002747.SZ    20200722  17.12  18.18  16.90  17.95      17.21    0.74   \n",
       "3    002747.SZ    20200721  17.20  17.87  16.77  17.21      16.97    0.24   \n",
       "4    002747.SZ    20200720  15.80  16.97  15.50  16.97      15.43    1.54   \n",
       "..         ...         ...    ...    ...    ...    ...        ...     ...   \n",
       "732  002747.SZ    20170707  11.36  11.43  11.22  11.28      11.43   -0.15   \n",
       "733  002747.SZ    20170706  11.49  11.53  11.36  11.43      11.53   -0.10   \n",
       "734  002747.SZ    20170705  11.52  11.65  11.47  11.53      11.56   -0.03   \n",
       "735  002747.SZ    20170704  11.50  11.68  11.45  11.56      11.50    0.06   \n",
       "736  002747.SZ    20170703  11.44  11.55  11.30  11.50      11.44    0.06   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "0    -1.8776  285487.23  460908.718  \n",
       "1    -8.0223  332693.07  561431.842  \n",
       "2     4.2998  184201.74  325956.565  \n",
       "3     1.4143  226621.76  390465.486  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "..       ...        ...         ...  \n",
       "732  -1.3100   69776.46   78795.099  \n",
       "733  -0.8700   51529.62   58924.662  \n",
       "734  -0.2600   50503.45   58339.668  \n",
       "735   0.5200   50820.01   58857.307  \n",
       "736   0.5200   41711.00   47616.602  \n",
       "\n",
       "[737 rows x 11 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('stock_data.csv', index_col=0)\n",
    "#df = pd.read_excel(\"stock_data.xls\", sheet_name='price')\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 存储数据\n",
    "\n",
    "将数据写入文件通常比从一个文件中读取数据更容易，因为pandas会为你处理转换的麻烦。\n",
    "\n",
    "我们将再次使用CSV文件。 read_csv（读取我们的数据）的反义词是to_csv，写入它。 使用CSV文件很简单。 要写回Excel文件，需要再次使用to_excel和sheet_name。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_csv('stock_data_head2.csv')\n",
    "#df.to_excel('stock_data_head.xls', sheet_name='price')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**统计信息概览**\n",
    "\n",
    "快速计算数值型数据的关键统计指标，像平均数、中位数、标准差等等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>7.370000e+02</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>2.018581e+07</td>\n",
       "      <td>11.002198</td>\n",
       "      <td>11.244084</td>\n",
       "      <td>10.789118</td>\n",
       "      <td>11.017123</td>\n",
       "      <td>11.010475</td>\n",
       "      <td>0.006649</td>\n",
       "      <td>0.093007</td>\n",
       "      <td>90858.378725</td>\n",
       "      <td>106162.360978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>9.637208e+03</td>\n",
       "      <td>1.889141</td>\n",
       "      <td>1.976465</td>\n",
       "      <td>1.827325</td>\n",
       "      <td>1.908847</td>\n",
       "      <td>1.899236</td>\n",
       "      <td>0.343773</td>\n",
       "      <td>2.983851</td>\n",
       "      <td>70279.618800</td>\n",
       "      <td>96928.400735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>2.017070e+07</td>\n",
       "      <td>7.770000</td>\n",
       "      <td>7.950000</td>\n",
       "      <td>7.750000</td>\n",
       "      <td>7.770000</td>\n",
       "      <td>7.770000</td>\n",
       "      <td>-1.440000</td>\n",
       "      <td>-10.018600</td>\n",
       "      <td>7829.000000</td>\n",
       "      <td>7891.632000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>2.018040e+07</td>\n",
       "      <td>9.360000</td>\n",
       "      <td>9.560000</td>\n",
       "      <td>9.210000</td>\n",
       "      <td>9.360000</td>\n",
       "      <td>9.360000</td>\n",
       "      <td>-0.170000</td>\n",
       "      <td>-1.530000</td>\n",
       "      <td>45415.130000</td>\n",
       "      <td>46596.916000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>2.019010e+07</td>\n",
       "      <td>10.890000</td>\n",
       "      <td>11.080000</td>\n",
       "      <td>10.610000</td>\n",
       "      <td>10.850000</td>\n",
       "      <td>10.850000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>68256.230000</td>\n",
       "      <td>75595.631000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>2.019102e+07</td>\n",
       "      <td>12.280000</td>\n",
       "      <td>12.560000</td>\n",
       "      <td>12.020000</td>\n",
       "      <td>12.290000</td>\n",
       "      <td>12.280000</td>\n",
       "      <td>0.160000</td>\n",
       "      <td>1.414300</td>\n",
       "      <td>110826.680000</td>\n",
       "      <td>130335.838000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>2.020072e+07</td>\n",
       "      <td>17.800000</td>\n",
       "      <td>18.180000</td>\n",
       "      <td>16.900000</td>\n",
       "      <td>17.950000</td>\n",
       "      <td>17.950000</td>\n",
       "      <td>1.540000</td>\n",
       "      <td>10.043700</td>\n",
       "      <td>543655.080000</td>\n",
       "      <td>814316.938000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         trade_date        open        high         low       close  \\\n",
       "count  7.370000e+02  737.000000  737.000000  737.000000  737.000000   \n",
       "mean   2.018581e+07   11.002198   11.244084   10.789118   11.017123   \n",
       "std    9.637208e+03    1.889141    1.976465    1.827325    1.908847   \n",
       "min    2.017070e+07    7.770000    7.950000    7.750000    7.770000   \n",
       "25%    2.018040e+07    9.360000    9.560000    9.210000    9.360000   \n",
       "50%    2.019010e+07   10.890000   11.080000   10.610000   10.850000   \n",
       "75%    2.019102e+07   12.280000   12.560000   12.020000   12.290000   \n",
       "max    2.020072e+07   17.800000   18.180000   16.900000   17.950000   \n",
       "\n",
       "        pre_close      change     pct_chg            vol         amount  \n",
       "count  737.000000  737.000000  737.000000     737.000000     737.000000  \n",
       "mean    11.010475    0.006649    0.093007   90858.378725  106162.360978  \n",
       "std      1.899236    0.343773    2.983851   70279.618800   96928.400735  \n",
       "min      7.770000   -1.440000  -10.018600    7829.000000    7891.632000  \n",
       "25%      9.360000   -0.170000   -1.530000   45415.130000   46596.916000  \n",
       "50%     10.850000    0.000000    0.000000   68256.230000   75595.631000  \n",
       "75%     12.280000    0.160000    1.414300  110826.680000  130335.838000  \n",
       "max     17.950000    1.540000   10.043700  543655.080000  814316.938000  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**列的基本处理方式**\n",
    "\n",
    "这里，我们采用SQL四大法宝的逻辑来简单梳理针对列的基本处理方式——增、删、选、改。\n",
    "\n",
    "温馨提示：使用Pandas时，尽量避免用行或者EXCEL操作单元格的思维来处理数据，要逐渐养成一种列向思维，每一列是同宗同源。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**增**  增加一列，用df['新列名'] = 新列值的形式，在原数据基础上赋值即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>new_col</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200724</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200723</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200722</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200721</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     ts_code  trade_date   open   high    low  close  pre_close  change  \\\n",
       "0  002747.SZ    20200724  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "1  002747.SZ    20200723  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "2  002747.SZ    20200722  17.12  18.18  16.90  17.95      17.21    0.74   \n",
       "3  002747.SZ    20200721  17.20  17.87  16.77  17.21      16.97    0.24   \n",
       "4  002747.SZ    20200720  15.80  16.97  15.50  16.97      15.43    1.54   \n",
       "\n",
       "   pct_chg        vol      amount  new_col  \n",
       "0  -1.8776  285487.23  460908.718        1  \n",
       "1  -8.0223  332693.07  561431.842        2  \n",
       "2   4.2998  184201.74  325956.565        3  \n",
       "3   1.4143  226621.76  390465.486        4  \n",
       "4   9.9806  320102.62  530137.992        5  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['new_col'] = range(1, len(df)+1)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**删**  我们用drop函数制定删除对应的列，axis = 1表示针对列的操作，inplace为True，则直接在源数据上进行修改，否则源数据会保持原样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.drop('new_col', axis = 1, inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200724</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200723</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200722</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200721</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>732</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170707</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.43</td>\n",
       "      <td>11.22</td>\n",
       "      <td>11.28</td>\n",
       "      <td>11.43</td>\n",
       "      <td>-0.15</td>\n",
       "      <td>-1.3100</td>\n",
       "      <td>69776.46</td>\n",
       "      <td>78795.099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>733</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170706</td>\n",
       "      <td>11.49</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.43</td>\n",
       "      <td>11.53</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>-0.8700</td>\n",
       "      <td>51529.62</td>\n",
       "      <td>58924.662</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>734</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170705</td>\n",
       "      <td>11.52</td>\n",
       "      <td>11.65</td>\n",
       "      <td>11.47</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.56</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2600</td>\n",
       "      <td>50503.45</td>\n",
       "      <td>58339.668</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>735</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170704</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11.68</td>\n",
       "      <td>11.45</td>\n",
       "      <td>11.56</td>\n",
       "      <td>11.50</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5200</td>\n",
       "      <td>50820.01</td>\n",
       "      <td>58857.307</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>736</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170703</td>\n",
       "      <td>11.44</td>\n",
       "      <td>11.55</td>\n",
       "      <td>11.30</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11.44</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5200</td>\n",
       "      <td>41711.00</td>\n",
       "      <td>47616.602</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>737 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date   open   high    low  close  pre_close  change  \\\n",
       "0    002747.SZ    20200724  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "1    002747.SZ    20200723  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "2    002747.SZ    20200722  17.12  18.18  16.90  17.95      17.21    0.74   \n",
       "3    002747.SZ    20200721  17.20  17.87  16.77  17.21      16.97    0.24   \n",
       "4    002747.SZ    20200720  15.80  16.97  15.50  16.97      15.43    1.54   \n",
       "..         ...         ...    ...    ...    ...    ...        ...     ...   \n",
       "732  002747.SZ    20170707  11.36  11.43  11.22  11.28      11.43   -0.15   \n",
       "733  002747.SZ    20170706  11.49  11.53  11.36  11.43      11.53   -0.10   \n",
       "734  002747.SZ    20170705  11.52  11.65  11.47  11.53      11.56   -0.03   \n",
       "735  002747.SZ    20170704  11.50  11.68  11.45  11.56      11.50    0.06   \n",
       "736  002747.SZ    20170703  11.44  11.55  11.30  11.50      11.44    0.06   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "0    -1.8776  285487.23  460908.718  \n",
       "1    -8.0223  332693.07  561431.842  \n",
       "2     4.2998  184201.74  325956.565  \n",
       "3     1.4143  226621.76  390465.486  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "..       ...        ...         ...  \n",
       "732  -1.3100   69776.46   78795.099  \n",
       "733  -0.8700   51529.62   58924.662  \n",
       "734  -0.2600   50503.45   58339.668  \n",
       "735   0.5200   50820.01   58857.307  \n",
       "736   0.5200   41711.00   47616.602  \n",
       "\n",
       "[737 rows x 11 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "有人能帮我理解一下，在pandas、numpy、scipy三都当中axis参数的真实含义吗？\n",
    "\n",
    "投票最高的答案揭示了问题的本质：\n",
    "\n",
    "- 其实问题理解axis有问题，df.mean其实是在每一行上取所有列的均值，而不是保留每一列的均值。也许简单的来记就是axis=0代表往跨行（down)，而axis=1代表跨列（across)，作为方法动作的副词\n",
    "\n",
    "![](assets/axis.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**选** 想要选取某一列怎么办？df['列名']即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>732</th>\n",
       "      <td>11.36</td>\n",
       "      <td>11.43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>733</th>\n",
       "      <td>11.49</td>\n",
       "      <td>11.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>734</th>\n",
       "      <td>11.52</td>\n",
       "      <td>11.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>735</th>\n",
       "      <td>11.50</td>\n",
       "      <td>11.68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>736</th>\n",
       "      <td>11.44</td>\n",
       "      <td>11.55</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>737 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      open   high\n",
       "0    16.80  16.81\n",
       "1    17.80  18.07\n",
       "2    17.12  18.18\n",
       "3    17.20  17.87\n",
       "4    15.80  16.97\n",
       "..     ...    ...\n",
       "732  11.36  11.43\n",
       "733  11.49  11.53\n",
       "734  11.52  11.65\n",
       "735  11.50  11.68\n",
       "736  11.44  11.55\n",
       "\n",
       "[737 rows x 2 columns]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['ts_code']\n",
    "df[['open','high']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    16.80\n",
       "1    17.80\n",
       "2    17.12\n",
       "3    17.20\n",
       "4    15.80\n",
       "Name: open, dtype: float64"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['open'].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**改**  简单的更改：df['旧列名'] =  某个值或者某列值，就完成了对原列数值的修改"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    116.80\n",
       "1    117.80\n",
       "2    117.12\n",
       "3    117.20\n",
       "4    115.80\n",
       "Name: open, dtype: float64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['open'] = df['open'] + 100\n",
    "df['open'].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**选（复杂索引）**  基于判断，输出布尔值，可以把这一列判断得到的值传入行参数位置，Pandas会默认返回结果为True的行（这里是索引从0到12的行），而丢掉结果为False的行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       True\n",
       "1       True\n",
       "2       True\n",
       "3       True\n",
       "4       True\n",
       "       ...  \n",
       "732    False\n",
       "733    False\n",
       "734    False\n",
       "735    False\n",
       "736    False\n",
       "Name: vol, Length: 737, dtype: bool"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 输出交易量大于平均交易量的数据\n",
    "df['vol'] > df['vol'].mean()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200724</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200723</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200722</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200721</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200717</td>\n",
       "      <td>14.86</td>\n",
       "      <td>15.80</td>\n",
       "      <td>14.80</td>\n",
       "      <td>15.43</td>\n",
       "      <td>14.87</td>\n",
       "      <td>0.56</td>\n",
       "      <td>3.7660</td>\n",
       "      <td>199292.16</td>\n",
       "      <td>305435.914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200716</td>\n",
       "      <td>14.95</td>\n",
       "      <td>16.10</td>\n",
       "      <td>14.83</td>\n",
       "      <td>14.87</td>\n",
       "      <td>15.23</td>\n",
       "      <td>-0.36</td>\n",
       "      <td>-2.3638</td>\n",
       "      <td>229290.80</td>\n",
       "      <td>353556.481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200715</td>\n",
       "      <td>15.40</td>\n",
       "      <td>15.60</td>\n",
       "      <td>14.80</td>\n",
       "      <td>15.23</td>\n",
       "      <td>15.20</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.1974</td>\n",
       "      <td>213356.58</td>\n",
       "      <td>323258.908</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200714</td>\n",
       "      <td>15.21</td>\n",
       "      <td>16.16</td>\n",
       "      <td>14.68</td>\n",
       "      <td>15.20</td>\n",
       "      <td>15.32</td>\n",
       "      <td>-0.12</td>\n",
       "      <td>-0.7833</td>\n",
       "      <td>222269.86</td>\n",
       "      <td>340759.697</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200713</td>\n",
       "      <td>14.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>14.75</td>\n",
       "      <td>15.32</td>\n",
       "      <td>15.12</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.3228</td>\n",
       "      <td>184452.45</td>\n",
       "      <td>278886.698</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200710</td>\n",
       "      <td>15.63</td>\n",
       "      <td>15.68</td>\n",
       "      <td>14.60</td>\n",
       "      <td>15.12</td>\n",
       "      <td>15.50</td>\n",
       "      <td>-0.38</td>\n",
       "      <td>-2.4516</td>\n",
       "      <td>218210.43</td>\n",
       "      <td>329484.318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200709</td>\n",
       "      <td>14.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200708</td>\n",
       "      <td>13.03</td>\n",
       "      <td>14.40</td>\n",
       "      <td>13.03</td>\n",
       "      <td>14.09</td>\n",
       "      <td>13.09</td>\n",
       "      <td>1.00</td>\n",
       "      <td>7.6394</td>\n",
       "      <td>293345.03</td>\n",
       "      <td>407198.381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200707</td>\n",
       "      <td>13.05</td>\n",
       "      <td>13.55</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.09</td>\n",
       "      <td>13.00</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.6923</td>\n",
       "      <td>184150.75</td>\n",
       "      <td>243893.075</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200706</td>\n",
       "      <td>12.97</td>\n",
       "      <td>13.16</td>\n",
       "      <td>12.78</td>\n",
       "      <td>13.00</td>\n",
       "      <td>12.90</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.7752</td>\n",
       "      <td>241303.32</td>\n",
       "      <td>313084.240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200703</td>\n",
       "      <td>12.39</td>\n",
       "      <td>13.10</td>\n",
       "      <td>12.30</td>\n",
       "      <td>12.90</td>\n",
       "      <td>12.35</td>\n",
       "      <td>0.55</td>\n",
       "      <td>4.4534</td>\n",
       "      <td>218369.18</td>\n",
       "      <td>278710.530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200702</td>\n",
       "      <td>12.37</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.05</td>\n",
       "      <td>12.35</td>\n",
       "      <td>12.38</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2423</td>\n",
       "      <td>164501.68</td>\n",
       "      <td>201440.634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200701</td>\n",
       "      <td>11.95</td>\n",
       "      <td>12.65</td>\n",
       "      <td>11.80</td>\n",
       "      <td>12.38</td>\n",
       "      <td>11.96</td>\n",
       "      <td>0.42</td>\n",
       "      <td>3.5117</td>\n",
       "      <td>228877.17</td>\n",
       "      <td>280866.551</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200630</td>\n",
       "      <td>11.62</td>\n",
       "      <td>12.15</td>\n",
       "      <td>11.51</td>\n",
       "      <td>11.96</td>\n",
       "      <td>11.58</td>\n",
       "      <td>0.38</td>\n",
       "      <td>3.2815</td>\n",
       "      <td>192286.30</td>\n",
       "      <td>228599.446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200629</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.77</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.39</td>\n",
       "      <td>3.4853</td>\n",
       "      <td>207979.77</td>\n",
       "      <td>237171.977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200624</td>\n",
       "      <td>11.32</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.35</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.4097</td>\n",
       "      <td>124793.19</td>\n",
       "      <td>140215.789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200623</td>\n",
       "      <td>11.09</td>\n",
       "      <td>11.72</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.35</td>\n",
       "      <td>11.08</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2.4368</td>\n",
       "      <td>223595.75</td>\n",
       "      <td>256107.121</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200622</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.31</td>\n",
       "      <td>10.93</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.05</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.2715</td>\n",
       "      <td>145578.40</td>\n",
       "      <td>161746.863</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200619</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.20</td>\n",
       "      <td>10.93</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.05</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>113959.89</td>\n",
       "      <td>125997.534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200618</td>\n",
       "      <td>11.22</td>\n",
       "      <td>11.39</td>\n",
       "      <td>11.00</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.33</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.4713</td>\n",
       "      <td>150478.58</td>\n",
       "      <td>168049.284</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200617</td>\n",
       "      <td>11.40</td>\n",
       "      <td>11.69</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.96</td>\n",
       "      <td>0.37</td>\n",
       "      <td>3.3759</td>\n",
       "      <td>278214.10</td>\n",
       "      <td>313691.260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200616</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.96</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.96</td>\n",
       "      <td>1.00</td>\n",
       "      <td>10.0402</td>\n",
       "      <td>177673.09</td>\n",
       "      <td>188478.610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200615</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.37</td>\n",
       "      <td>9.95</td>\n",
       "      <td>9.96</td>\n",
       "      <td>10.24</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.7344</td>\n",
       "      <td>131237.86</td>\n",
       "      <td>133263.669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200609</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.95</td>\n",
       "      <td>10.60</td>\n",
       "      <td>10.74</td>\n",
       "      <td>10.90</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.4679</td>\n",
       "      <td>107257.02</td>\n",
       "      <td>115350.037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200608</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.23</td>\n",
       "      <td>10.84</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.98</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.7286</td>\n",
       "      <td>118986.02</td>\n",
       "      <td>130820.131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>681</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170918</td>\n",
       "      <td>14.76</td>\n",
       "      <td>15.26</td>\n",
       "      <td>14.53</td>\n",
       "      <td>14.68</td>\n",
       "      <td>14.97</td>\n",
       "      <td>-0.29</td>\n",
       "      <td>-1.9400</td>\n",
       "      <td>153897.99</td>\n",
       "      <td>228707.483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>682</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170915</td>\n",
       "      <td>14.58</td>\n",
       "      <td>15.14</td>\n",
       "      <td>14.36</td>\n",
       "      <td>14.97</td>\n",
       "      <td>14.81</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.0800</td>\n",
       "      <td>201289.19</td>\n",
       "      <td>297906.732</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>683</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170914</td>\n",
       "      <td>15.13</td>\n",
       "      <td>15.80</td>\n",
       "      <td>14.80</td>\n",
       "      <td>14.81</td>\n",
       "      <td>14.95</td>\n",
       "      <td>-0.14</td>\n",
       "      <td>-0.9400</td>\n",
       "      <td>353446.43</td>\n",
       "      <td>539255.175</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>684</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170913</td>\n",
       "      <td>14.49</td>\n",
       "      <td>15.06</td>\n",
       "      <td>14.00</td>\n",
       "      <td>14.95</td>\n",
       "      <td>14.70</td>\n",
       "      <td>0.25</td>\n",
       "      <td>1.7000</td>\n",
       "      <td>328431.65</td>\n",
       "      <td>476672.593</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>685</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170912</td>\n",
       "      <td>14.75</td>\n",
       "      <td>15.56</td>\n",
       "      <td>14.58</td>\n",
       "      <td>14.70</td>\n",
       "      <td>14.82</td>\n",
       "      <td>-0.12</td>\n",
       "      <td>-0.8100</td>\n",
       "      <td>543655.08</td>\n",
       "      <td>814316.938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>686</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170911</td>\n",
       "      <td>13.50</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.37</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.47</td>\n",
       "      <td>1.35</td>\n",
       "      <td>10.0200</td>\n",
       "      <td>490574.54</td>\n",
       "      <td>708201.434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>687</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170908</td>\n",
       "      <td>13.78</td>\n",
       "      <td>13.79</td>\n",
       "      <td>13.24</td>\n",
       "      <td>13.47</td>\n",
       "      <td>13.87</td>\n",
       "      <td>-0.40</td>\n",
       "      <td>-2.8800</td>\n",
       "      <td>251060.04</td>\n",
       "      <td>337836.218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170907</td>\n",
       "      <td>14.30</td>\n",
       "      <td>14.32</td>\n",
       "      <td>13.81</td>\n",
       "      <td>13.87</td>\n",
       "      <td>14.44</td>\n",
       "      <td>-0.57</td>\n",
       "      <td>-3.9500</td>\n",
       "      <td>245508.61</td>\n",
       "      <td>344740.766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>689</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170906</td>\n",
       "      <td>13.96</td>\n",
       "      <td>14.74</td>\n",
       "      <td>13.88</td>\n",
       "      <td>14.44</td>\n",
       "      <td>14.24</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.4000</td>\n",
       "      <td>341862.55</td>\n",
       "      <td>491219.726</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>690</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170905</td>\n",
       "      <td>13.48</td>\n",
       "      <td>14.57</td>\n",
       "      <td>13.22</td>\n",
       "      <td>14.24</td>\n",
       "      <td>13.53</td>\n",
       "      <td>0.71</td>\n",
       "      <td>5.2500</td>\n",
       "      <td>409734.21</td>\n",
       "      <td>574570.382</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>691</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170904</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.30</td>\n",
       "      <td>1.23</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>312931.88</td>\n",
       "      <td>409827.692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>695</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170829</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.30</td>\n",
       "      <td>12.45</td>\n",
       "      <td>12.69</td>\n",
       "      <td>-0.24</td>\n",
       "      <td>-1.8900</td>\n",
       "      <td>94616.85</td>\n",
       "      <td>117154.873</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>696</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170828</td>\n",
       "      <td>12.52</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.52</td>\n",
       "      <td>12.69</td>\n",
       "      <td>12.47</td>\n",
       "      <td>0.22</td>\n",
       "      <td>1.7600</td>\n",
       "      <td>107939.73</td>\n",
       "      <td>137234.693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>698</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170824</td>\n",
       "      <td>12.83</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.84</td>\n",
       "      <td>-0.36</td>\n",
       "      <td>-2.8000</td>\n",
       "      <td>111538.10</td>\n",
       "      <td>138581.242</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>699</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170823</td>\n",
       "      <td>12.45</td>\n",
       "      <td>13.43</td>\n",
       "      <td>12.45</td>\n",
       "      <td>12.84</td>\n",
       "      <td>12.26</td>\n",
       "      <td>0.58</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>188946.84</td>\n",
       "      <td>243652.628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>700</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170822</td>\n",
       "      <td>12.80</td>\n",
       "      <td>12.85</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.26</td>\n",
       "      <td>12.74</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.7700</td>\n",
       "      <td>106203.76</td>\n",
       "      <td>132018.325</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>702</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170818</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.60</td>\n",
       "      <td>12.66</td>\n",
       "      <td>12.92</td>\n",
       "      <td>-0.26</td>\n",
       "      <td>-2.0100</td>\n",
       "      <td>103992.25</td>\n",
       "      <td>132189.295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>703</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170817</td>\n",
       "      <td>12.28</td>\n",
       "      <td>13.56</td>\n",
       "      <td>12.18</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.38</td>\n",
       "      <td>0.54</td>\n",
       "      <td>4.3600</td>\n",
       "      <td>241490.81</td>\n",
       "      <td>309030.232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>704</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170816</td>\n",
       "      <td>12.38</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.38</td>\n",
       "      <td>12.29</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.7300</td>\n",
       "      <td>92100.24</td>\n",
       "      <td>113470.570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>705</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170815</td>\n",
       "      <td>12.44</td>\n",
       "      <td>12.67</td>\n",
       "      <td>12.16</td>\n",
       "      <td>12.29</td>\n",
       "      <td>12.47</td>\n",
       "      <td>-0.18</td>\n",
       "      <td>-1.4400</td>\n",
       "      <td>96385.67</td>\n",
       "      <td>118870.079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>706</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170814</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.58</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.47</td>\n",
       "      <td>12.11</td>\n",
       "      <td>0.36</td>\n",
       "      <td>2.9700</td>\n",
       "      <td>115510.84</td>\n",
       "      <td>143132.278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>707</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170811</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.68</td>\n",
       "      <td>12.08</td>\n",
       "      <td>12.11</td>\n",
       "      <td>12.40</td>\n",
       "      <td>-0.29</td>\n",
       "      <td>-2.3400</td>\n",
       "      <td>128648.45</td>\n",
       "      <td>158873.570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>708</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170810</td>\n",
       "      <td>12.12</td>\n",
       "      <td>12.40</td>\n",
       "      <td>11.50</td>\n",
       "      <td>12.40</td>\n",
       "      <td>12.24</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.3100</td>\n",
       "      <td>146709.17</td>\n",
       "      <td>176845.683</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>709</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170809</td>\n",
       "      <td>11.91</td>\n",
       "      <td>12.50</td>\n",
       "      <td>11.91</td>\n",
       "      <td>12.24</td>\n",
       "      <td>11.86</td>\n",
       "      <td>0.38</td>\n",
       "      <td>3.2000</td>\n",
       "      <td>219338.05</td>\n",
       "      <td>269819.114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>713</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170803</td>\n",
       "      <td>11.59</td>\n",
       "      <td>11.97</td>\n",
       "      <td>11.45</td>\n",
       "      <td>11.90</td>\n",
       "      <td>11.78</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.0200</td>\n",
       "      <td>142621.06</td>\n",
       "      <td>167400.909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>714</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170802</td>\n",
       "      <td>11.17</td>\n",
       "      <td>12.30</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.78</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.59</td>\n",
       "      <td>5.2700</td>\n",
       "      <td>199954.40</td>\n",
       "      <td>236128.395</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>718</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170727</td>\n",
       "      <td>11.26</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.01</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.22</td>\n",
       "      <td>1.9700</td>\n",
       "      <td>114912.20</td>\n",
       "      <td>130409.432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170725</td>\n",
       "      <td>11.34</td>\n",
       "      <td>11.42</td>\n",
       "      <td>11.06</td>\n",
       "      <td>11.29</td>\n",
       "      <td>11.52</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.0000</td>\n",
       "      <td>110796.27</td>\n",
       "      <td>124175.062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170724</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.88</td>\n",
       "      <td>11.11</td>\n",
       "      <td>11.52</td>\n",
       "      <td>11.12</td>\n",
       "      <td>0.40</td>\n",
       "      <td>3.6000</td>\n",
       "      <td>225583.50</td>\n",
       "      <td>259010.552</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170721</td>\n",
       "      <td>10.30</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.28</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.11</td>\n",
       "      <td>1.01</td>\n",
       "      <td>9.9900</td>\n",
       "      <td>161723.79</td>\n",
       "      <td>177758.596</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>249 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date   open   high    low  close  pre_close  change  \\\n",
       "0    002747.SZ    20200724  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "1    002747.SZ    20200723  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "2    002747.SZ    20200722  17.12  18.18  16.90  17.95      17.21    0.74   \n",
       "3    002747.SZ    20200721  17.20  17.87  16.77  17.21      16.97    0.24   \n",
       "4    002747.SZ    20200720  15.80  16.97  15.50  16.97      15.43    1.54   \n",
       "5    002747.SZ    20200717  14.86  15.80  14.80  15.43      14.87    0.56   \n",
       "6    002747.SZ    20200716  14.95  16.10  14.83  14.87      15.23   -0.36   \n",
       "7    002747.SZ    20200715  15.40  15.60  14.80  15.23      15.20    0.03   \n",
       "8    002747.SZ    20200714  15.21  16.16  14.68  15.20      15.32   -0.12   \n",
       "9    002747.SZ    20200713  14.97  15.43  14.75  15.32      15.12    0.20   \n",
       "10   002747.SZ    20200710  15.63  15.68  14.60  15.12      15.50   -0.38   \n",
       "11   002747.SZ    20200709  14.20  15.50  14.01  15.50      14.09    1.41   \n",
       "12   002747.SZ    20200708  13.03  14.40  13.03  14.09      13.09    1.00   \n",
       "13   002747.SZ    20200707  13.05  13.55  12.92  13.09      13.00    0.09   \n",
       "14   002747.SZ    20200706  12.97  13.16  12.78  13.00      12.90    0.10   \n",
       "15   002747.SZ    20200703  12.39  13.10  12.30  12.90      12.35    0.55   \n",
       "16   002747.SZ    20200702  12.37  12.48  12.05  12.35      12.38   -0.03   \n",
       "17   002747.SZ    20200701  11.95  12.65  11.80  12.38      11.96    0.42   \n",
       "18   002747.SZ    20200630  11.62  12.15  11.51  11.96      11.58    0.38   \n",
       "19   002747.SZ    20200629  11.17  11.77  10.96  11.58      11.19    0.39   \n",
       "20   002747.SZ    20200624  11.32  11.41  11.08  11.19      11.35   -0.16   \n",
       "21   002747.SZ    20200623  11.09  11.72  11.03  11.35      11.08    0.27   \n",
       "22   002747.SZ    20200622  11.10  11.31  10.93  11.08      11.05    0.03   \n",
       "23   002747.SZ    20200619  11.15  11.20  10.93  11.05      11.05    0.00   \n",
       "24   002747.SZ    20200618  11.22  11.39  11.00  11.05      11.33   -0.28   \n",
       "25   002747.SZ    20200617  11.40  11.69  11.10  11.33      10.96    0.37   \n",
       "26   002747.SZ    20200616  10.09  10.96  10.05  10.96       9.96    1.00   \n",
       "27   002747.SZ    20200615  10.24  10.37   9.95   9.96      10.24   -0.28   \n",
       "31   002747.SZ    20200609  10.88  10.95  10.60  10.74      10.90   -0.16   \n",
       "32   002747.SZ    20200608  11.03  11.23  10.84  10.90      10.98   -0.08   \n",
       "..         ...         ...    ...    ...    ...    ...        ...     ...   \n",
       "681  002747.SZ    20170918  14.76  15.26  14.53  14.68      14.97   -0.29   \n",
       "682  002747.SZ    20170915  14.58  15.14  14.36  14.97      14.81    0.16   \n",
       "683  002747.SZ    20170914  15.13  15.80  14.80  14.81      14.95   -0.14   \n",
       "684  002747.SZ    20170913  14.49  15.06  14.00  14.95      14.70    0.25   \n",
       "685  002747.SZ    20170912  14.75  15.56  14.58  14.70      14.82   -0.12   \n",
       "686  002747.SZ    20170911  13.50  14.82  13.37  14.82      13.47    1.35   \n",
       "687  002747.SZ    20170908  13.78  13.79  13.24  13.47      13.87   -0.40   \n",
       "688  002747.SZ    20170907  14.30  14.32  13.81  13.87      14.44   -0.57   \n",
       "689  002747.SZ    20170906  13.96  14.74  13.88  14.44      14.24    0.20   \n",
       "690  002747.SZ    20170905  13.48  14.57  13.22  14.24      13.53    0.71   \n",
       "691  002747.SZ    20170904  12.22  13.53  12.22  13.53      12.30    1.23   \n",
       "695  002747.SZ    20170829  12.54  12.54  12.30  12.45      12.69   -0.24   \n",
       "696  002747.SZ    20170828  12.52  12.89  12.52  12.69      12.47    0.22   \n",
       "698  002747.SZ    20170824  12.83  12.86  12.20  12.48      12.84   -0.36   \n",
       "699  002747.SZ    20170823  12.45  13.43  12.45  12.84      12.26    0.58   \n",
       "700  002747.SZ    20170822  12.80  12.85  12.20  12.26      12.74   -0.48   \n",
       "702  002747.SZ    20170818  12.76  12.89  12.60  12.66      12.92   -0.26   \n",
       "703  002747.SZ    20170817  12.28  13.56  12.18  12.92      12.38    0.54   \n",
       "704  002747.SZ    20170816  12.38  12.54  12.10  12.38      12.29    0.09   \n",
       "705  002747.SZ    20170815  12.44  12.67  12.16  12.29      12.47   -0.18   \n",
       "706  002747.SZ    20170814  12.10  12.58  12.10  12.47      12.11    0.36   \n",
       "707  002747.SZ    20170811  12.20  12.68  12.08  12.11      12.40   -0.29   \n",
       "708  002747.SZ    20170810  12.12  12.40  11.50  12.40      12.24    0.16   \n",
       "709  002747.SZ    20170809  11.91  12.50  11.91  12.24      11.86    0.38   \n",
       "713  002747.SZ    20170803  11.59  11.97  11.45  11.90      11.78    0.12   \n",
       "714  002747.SZ    20170802  11.17  12.30  11.17  11.78      11.19    0.59   \n",
       "718  002747.SZ    20170727  11.26  11.58  11.01  11.41      11.19    0.22   \n",
       "720  002747.SZ    20170725  11.34  11.42  11.06  11.29      11.52   -0.23   \n",
       "721  002747.SZ    20170724  11.19  11.88  11.11  11.52      11.12    0.40   \n",
       "722  002747.SZ    20170721  10.30  11.12  10.28  11.12      10.11    1.01   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "0    -1.8776  285487.23  460908.718  \n",
       "1    -8.0223  332693.07  561431.842  \n",
       "2     4.2998  184201.74  325956.565  \n",
       "3     1.4143  226621.76  390465.486  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "5     3.7660  199292.16  305435.914  \n",
       "6    -2.3638  229290.80  353556.481  \n",
       "7     0.1974  213356.58  323258.908  \n",
       "8    -0.7833  222269.86  340759.697  \n",
       "9     1.3228  184452.45  278886.698  \n",
       "10   -2.4516  218210.43  329484.318  \n",
       "11   10.0071  267772.91  395199.486  \n",
       "12    7.6394  293345.03  407198.381  \n",
       "13    0.6923  184150.75  243893.075  \n",
       "14    0.7752  241303.32  313084.240  \n",
       "15    4.4534  218369.18  278710.530  \n",
       "16   -0.2423  164501.68  201440.634  \n",
       "17    3.5117  228877.17  280866.551  \n",
       "18    3.2815  192286.30  228599.446  \n",
       "19    3.4853  207979.77  237171.977  \n",
       "20   -1.4097  124793.19  140215.789  \n",
       "21    2.4368  223595.75  256107.121  \n",
       "22    0.2715  145578.40  161746.863  \n",
       "23    0.0000  113959.89  125997.534  \n",
       "24   -2.4713  150478.58  168049.284  \n",
       "25    3.3759  278214.10  313691.260  \n",
       "26   10.0402  177673.09  188478.610  \n",
       "27   -2.7344  131237.86  133263.669  \n",
       "31   -1.4679  107257.02  115350.037  \n",
       "32   -0.7286  118986.02  130820.131  \n",
       "..       ...        ...         ...  \n",
       "681  -1.9400  153897.99  228707.483  \n",
       "682   1.0800  201289.19  297906.732  \n",
       "683  -0.9400  353446.43  539255.175  \n",
       "684   1.7000  328431.65  476672.593  \n",
       "685  -0.8100  543655.08  814316.938  \n",
       "686  10.0200  490574.54  708201.434  \n",
       "687  -2.8800  251060.04  337836.218  \n",
       "688  -3.9500  245508.61  344740.766  \n",
       "689   1.4000  341862.55  491219.726  \n",
       "690   5.2500  409734.21  574570.382  \n",
       "691  10.0000  312931.88  409827.692  \n",
       "695  -1.8900   94616.85  117154.873  \n",
       "696   1.7600  107939.73  137234.693  \n",
       "698  -2.8000  111538.10  138581.242  \n",
       "699   4.7300  188946.84  243652.628  \n",
       "700  -3.7700  106203.76  132018.325  \n",
       "702  -2.0100  103992.25  132189.295  \n",
       "703   4.3600  241490.81  309030.232  \n",
       "704   0.7300   92100.24  113470.570  \n",
       "705  -1.4400   96385.67  118870.079  \n",
       "706   2.9700  115510.84  143132.278  \n",
       "707  -2.3400  128648.45  158873.570  \n",
       "708   1.3100  146709.17  176845.683  \n",
       "709   3.2000  219338.05  269819.114  \n",
       "713   1.0200  142621.06  167400.909  \n",
       "714   5.2700  199954.40  236128.395  \n",
       "718   1.9700  114912.20  130409.432  \n",
       "720  -2.0000  110796.27  124175.062  \n",
       "721   3.6000  225583.50  259010.552  \n",
       "722   9.9900  161723.79  177758.596  \n",
       "\n",
       "[249 rows x 11 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[df['vol'] > df['vol'].mean(),:]\n",
    "# iloc[3,5], ix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>115.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200709</td>\n",
       "      <td>114.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200616</td>\n",
       "      <td>110.09</td>\n",
       "      <td>10.96</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.96</td>\n",
       "      <td>1.00</td>\n",
       "      <td>10.0402</td>\n",
       "      <td>177673.09</td>\n",
       "      <td>188478.610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200206</td>\n",
       "      <td>110.70</td>\n",
       "      <td>11.78</td>\n",
       "      <td>10.50</td>\n",
       "      <td>11.78</td>\n",
       "      <td>10.71</td>\n",
       "      <td>1.07</td>\n",
       "      <td>9.9907</td>\n",
       "      <td>256243.34</td>\n",
       "      <td>289982.744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200109</td>\n",
       "      <td>111.24</td>\n",
       "      <td>12.20</td>\n",
       "      <td>11.23</td>\n",
       "      <td>12.20</td>\n",
       "      <td>11.09</td>\n",
       "      <td>1.11</td>\n",
       "      <td>10.0090</td>\n",
       "      <td>204716.67</td>\n",
       "      <td>243318.704</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>210</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20190909</td>\n",
       "      <td>110.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>9.16</td>\n",
       "      <td>0.92</td>\n",
       "      <td>10.0437</td>\n",
       "      <td>7829.00</td>\n",
       "      <td>7891.632</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>329</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20190305</td>\n",
       "      <td>110.45</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.35</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.30</td>\n",
       "      <td>1.03</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>201177.91</td>\n",
       "      <td>218377.167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>542</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180418</td>\n",
       "      <td>111.84</td>\n",
       "      <td>12.87</td>\n",
       "      <td>11.70</td>\n",
       "      <td>12.87</td>\n",
       "      <td>11.70</td>\n",
       "      <td>1.17</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>258711.20</td>\n",
       "      <td>325185.223</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>686</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170911</td>\n",
       "      <td>113.50</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.37</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.47</td>\n",
       "      <td>1.35</td>\n",
       "      <td>10.0200</td>\n",
       "      <td>490574.54</td>\n",
       "      <td>708201.434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>691</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170904</td>\n",
       "      <td>112.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.30</td>\n",
       "      <td>1.23</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>312931.88</td>\n",
       "      <td>409827.692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170721</td>\n",
       "      <td>110.30</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.28</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.11</td>\n",
       "      <td>1.01</td>\n",
       "      <td>9.9900</td>\n",
       "      <td>161723.79</td>\n",
       "      <td>177758.596</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date    open   high    low  close  pre_close  change  \\\n",
       "4    002747.SZ    20200720  115.80  16.97  15.50  16.97      15.43    1.54   \n",
       "11   002747.SZ    20200709  114.20  15.50  14.01  15.50      14.09    1.41   \n",
       "26   002747.SZ    20200616  110.09  10.96  10.05  10.96       9.96    1.00   \n",
       "115  002747.SZ    20200206  110.70  11.78  10.50  11.78      10.71    1.07   \n",
       "129  002747.SZ    20200109  111.24  12.20  11.23  12.20      11.09    1.11   \n",
       "210  002747.SZ    20190909  110.08  10.08  10.08  10.08       9.16    0.92   \n",
       "329  002747.SZ    20190305  110.45  11.33  10.35  11.33      10.30    1.03   \n",
       "542  002747.SZ    20180418  111.84  12.87  11.70  12.87      11.70    1.17   \n",
       "686  002747.SZ    20170911  113.50  14.82  13.37  14.82      13.47    1.35   \n",
       "691  002747.SZ    20170904  112.22  13.53  12.22  13.53      12.30    1.23   \n",
       "722  002747.SZ    20170721  110.30  11.12  10.28  11.12      10.11    1.01   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "11   10.0071  267772.91  395199.486  \n",
       "26   10.0402  177673.09  188478.610  \n",
       "115   9.9907  256243.34  289982.744  \n",
       "129  10.0090  204716.67  243318.704  \n",
       "210  10.0437    7829.00    7891.632  \n",
       "329  10.0000  201177.91  218377.167  \n",
       "542  10.0000  258711.20  325185.223  \n",
       "686  10.0200  490574.54  708201.434  \n",
       "691  10.0000  312931.88  409827.692  \n",
       "722   9.9900  161723.79  177758.596  "
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[df['pct_chg'] > 9.9,:] # 输出所有涨停的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200722</td>\n",
       "      <td>117.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200721</td>\n",
       "      <td>117.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>115.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200723</td>\n",
       "      <td>117.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>476</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180724</td>\n",
       "      <td>115.18</td>\n",
       "      <td>16.42</td>\n",
       "      <td>15.18</td>\n",
       "      <td>16.35</td>\n",
       "      <td>15.25</td>\n",
       "      <td>1.10</td>\n",
       "      <td>7.2131</td>\n",
       "      <td>189263.20</td>\n",
       "      <td>301483.183</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200724</td>\n",
       "      <td>116.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>475</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180725</td>\n",
       "      <td>116.16</td>\n",
       "      <td>16.26</td>\n",
       "      <td>15.81</td>\n",
       "      <td>15.90</td>\n",
       "      <td>16.35</td>\n",
       "      <td>-0.45</td>\n",
       "      <td>-2.7523</td>\n",
       "      <td>110424.70</td>\n",
       "      <td>176590.221</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>480</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180718</td>\n",
       "      <td>115.60</td>\n",
       "      <td>16.15</td>\n",
       "      <td>15.37</td>\n",
       "      <td>15.69</td>\n",
       "      <td>15.52</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.1000</td>\n",
       "      <td>167440.56</td>\n",
       "      <td>263707.018</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>481</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180717</td>\n",
       "      <td>114.60</td>\n",
       "      <td>15.75</td>\n",
       "      <td>14.60</td>\n",
       "      <td>15.52</td>\n",
       "      <td>14.70</td>\n",
       "      <td>0.82</td>\n",
       "      <td>5.5800</td>\n",
       "      <td>200447.43</td>\n",
       "      <td>307922.803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200709</td>\n",
       "      <td>114.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date    open   high    low  close  pre_close  change  \\\n",
       "2    002747.SZ    20200722  117.12  18.18  16.90  17.95      17.21    0.74   \n",
       "3    002747.SZ    20200721  117.20  17.87  16.77  17.21      16.97    0.24   \n",
       "4    002747.SZ    20200720  115.80  16.97  15.50  16.97      15.43    1.54   \n",
       "1    002747.SZ    20200723  117.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "476  002747.SZ    20180724  115.18  16.42  15.18  16.35      15.25    1.10   \n",
       "0    002747.SZ    20200724  116.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "475  002747.SZ    20180725  116.16  16.26  15.81  15.90      16.35   -0.45   \n",
       "480  002747.SZ    20180718  115.60  16.15  15.37  15.69      15.52    0.17   \n",
       "481  002747.SZ    20180717  114.60  15.75  14.60  15.52      14.70    0.82   \n",
       "11   002747.SZ    20200709  114.20  15.50  14.01  15.50      14.09    1.41   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "2     4.2998  184201.74  325956.565  \n",
       "3     1.4143  226621.76  390465.486  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "1    -8.0223  332693.07  561431.842  \n",
       "476   7.2131  189263.20  301483.183  \n",
       "0    -1.8776  285487.23  460908.718  \n",
       "475  -2.7523  110424.70  176590.221  \n",
       "480   1.1000  167440.56  263707.018  \n",
       "481   5.5800  200447.43  307922.803  \n",
       "11   10.0071  267772.91  395199.486  "
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sort_df = df.sort_values('close', ascending = False)\n",
    "sort_df.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Apply 函数\n",
    "\n",
    "1. 因为apply函数极其灵活高效，甚至是重新定义了pandas的灵活；\n",
    "2. apply概念相对晦涩，需要结合具体案例去咀嚼和实践。\n",
    "\n",
    "该函数经常和df.groupby一起使用, df.groupby() 函数返回的对象是一系列键值对，其中键是分组的字段值，值是该字段值下的数据表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "002350.SZ\n",
      "     trade_date    ts_code  open  high   low  close  pre_close  change  \\\n",
      "552    20200729  002350.SZ  5.36  5.46  5.28   5.45       5.37    0.08   \n",
      "553    20200728  002350.SZ  5.35  5.42  5.31   5.37       5.35    0.02   \n",
      "554    20200727  002350.SZ  5.32  5.42  5.26   5.35       5.31    0.04   \n",
      "555    20200724  002350.SZ  5.47  5.54  5.31   5.31       5.49   -0.18   \n",
      "556    20200723  002350.SZ  5.48  5.49  5.32   5.49       5.51   -0.02   \n",
      "..          ...        ...   ...   ...   ...    ...        ...     ...   \n",
      "684    20200108  002350.SZ  6.20  6.52  6.01   6.05       5.93    0.12   \n",
      "685    20200107  002350.SZ  5.75  6.07  5.75   5.93       5.72    0.21   \n",
      "686    20200106  002350.SZ  5.65  5.74  5.65   5.72       5.69    0.03   \n",
      "687    20200103  002350.SZ  5.66  5.74  5.65   5.69       5.67    0.02   \n",
      "688    20200102  002350.SZ  5.65  5.68  5.60   5.67       5.60    0.07   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "552   1.4898   42830.66   23080.964  \n",
      "553   0.3738   37933.56   20376.337  \n",
      "554   0.7533   35949.53   19174.805  \n",
      "555  -3.2787   57973.46   31432.824  \n",
      "556  -0.3630   57060.82   30938.142  \n",
      "..       ...        ...         ...  \n",
      "684   2.0236  182015.88  111934.573  \n",
      "685   3.6713  101464.57   59886.982  \n",
      "686   0.5272   28396.10   16216.815  \n",
      "687   0.3527   23224.10   13208.640  \n",
      "688   1.2500   30157.31   17036.562  \n",
      "\n",
      "[137 rows x 11 columns]\n",
      "\n",
      "002660.SZ\n",
      "     trade_date    ts_code  open  high   low  close  pre_close  change  \\\n",
      "414    20200729  002660.SZ  8.73  8.93  8.61   8.92       8.72    0.20   \n",
      "415    20200728  002660.SZ  8.73  8.76  8.61   8.72       8.64    0.08   \n",
      "416    20200727  002660.SZ  8.80  8.85  8.51   8.64       8.80   -0.16   \n",
      "417    20200724  002660.SZ  9.13  9.19  8.72   8.80       9.14   -0.34   \n",
      "418    20200723  002660.SZ  9.30  9.33  8.90   9.14       9.39   -0.25   \n",
      "..          ...        ...   ...   ...   ...    ...        ...     ...   \n",
      "547    20200108  002660.SZ  9.20  9.74  9.11   9.43       9.25    0.18   \n",
      "548    20200107  002660.SZ  9.10  9.29  9.10   9.25       9.10    0.15   \n",
      "549    20200106  002660.SZ  8.82  9.18  8.82   9.10       8.92    0.18   \n",
      "550    20200103  002660.SZ  8.87  8.93  8.74   8.92       8.91    0.01   \n",
      "551    20200102  002660.SZ  8.81  8.93  8.81   8.91       8.77    0.14   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "414   2.2936   63362.62   55703.310  \n",
      "415   0.9259   42190.76   36687.481  \n",
      "416  -1.8182   61405.74   53229.802  \n",
      "417  -3.7199   82550.62   74058.606  \n",
      "418  -2.6624  104026.37   94870.030  \n",
      "..       ...        ...         ...  \n",
      "547   1.9459  209118.43  196190.989  \n",
      "548   1.6484  119248.88  109812.431  \n",
      "549   2.0179  141182.18  127321.875  \n",
      "550   0.1122   92711.84   82148.910  \n",
      "551   1.5964  107782.16   95686.697  \n",
      "\n",
      "[138 rows x 11 columns]\n",
      "\n",
      "002747.SZ\n",
      "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
      "138    20200729  002747.SZ  15.58  16.69  15.40  16.53      15.60    0.93   \n",
      "139    20200728  002747.SZ  15.68  15.98  15.22  15.60      15.38    0.22   \n",
      "140    20200727  002747.SZ  16.15  16.16  15.15  15.38      16.20   -0.82   \n",
      "141    20200724  002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
      "142    20200723  002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
      "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
      "271    20200108  002747.SZ  11.25  11.36  11.00  11.09      11.37   -0.28   \n",
      "272    20200107  002747.SZ  11.07  11.39  10.98  11.37      11.07    0.30   \n",
      "273    20200106  002747.SZ  11.11  11.23  10.92  11.07      11.27   -0.20   \n",
      "274    20200103  002747.SZ  11.36  11.48  11.21  11.27      11.29   -0.02   \n",
      "275    20200102  002747.SZ  11.29  11.48  11.25  11.29      11.26    0.03   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "138   5.9615  187518.29  300984.436  \n",
      "139   1.4304  125663.79  195823.200  \n",
      "140  -5.0617  228584.90  355934.528  \n",
      "141  -1.8776  285487.23  460908.718  \n",
      "142  -8.0223  332693.07  561431.842  \n",
      "..       ...        ...         ...  \n",
      "271  -2.4626   96183.16  107562.563  \n",
      "272   2.7100  154765.09  173100.122  \n",
      "273  -1.7746  159696.02  176331.575  \n",
      "274  -0.1771   51916.83   58771.700  \n",
      "275   0.2664   77374.66   87830.416  \n",
      "\n",
      "[138 rows x 11 columns]\n",
      "\n",
      "300685.SZ\n",
      "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
      "0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
      "1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
      "2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
      "3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
      "4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
      "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
      "133    20200108  300685.SZ  67.53  67.97  66.60  66.87      67.50   -0.63   \n",
      "134    20200107  300685.SZ  64.83  67.57  64.39  67.50      64.83    2.67   \n",
      "135    20200106  300685.SZ  66.90  66.90  64.25  64.83      66.97   -2.14   \n",
      "136    20200103  300685.SZ  66.48  67.50  66.48  66.97      66.77    0.20   \n",
      "137    20200102  300685.SZ  67.00  67.47  65.78  66.77      66.82   -0.05   \n",
      "\n",
      "     pct_chg       vol      amount  \n",
      "0     4.3701  48231.39  378538.641  \n",
      "1     1.1012  45510.24  349243.253  \n",
      "2     6.1699  40116.85  298893.827  \n",
      "3    -8.5534  45608.24  338125.593  \n",
      "4     0.9493  46867.92  367416.632  \n",
      "..       ...       ...         ...  \n",
      "133  -0.9333  10127.58   67835.534  \n",
      "134   4.1185  22472.05  149042.950  \n",
      "135  -3.1955  20209.69  131276.340  \n",
      "136   0.2995   9629.20   64442.805  \n",
      "137  -0.0748  11580.00   77024.479  \n",
      "\n",
      "[138 rows x 11 columns]\n",
      "\n",
      "603288.SH\n",
      "     trade_date    ts_code    open    high     low   close  pre_close  change  \\\n",
      "276    20200729  603288.SH  145.14  148.80  143.79  148.60     146.19    2.41   \n",
      "277    20200728  603288.SH  145.90  152.00  145.00  146.19     144.99    1.20   \n",
      "278    20200727  603288.SH  138.43  145.42  136.83  144.99     137.07    7.92   \n",
      "279    20200724  603288.SH  140.70  140.97  136.25  137.07     140.70   -3.63   \n",
      "280    20200723  603288.SH  134.99  142.43  134.00  140.70     135.88    4.82   \n",
      "..          ...        ...     ...     ...     ...     ...        ...     ...   \n",
      "409    20200108  603288.SH  106.00  106.73  105.02  106.17     106.00    0.17   \n",
      "410    20200107  603288.SH  103.83  106.00  103.83  106.00     103.62    2.38   \n",
      "411    20200106  603288.SH  104.72  104.98  103.31  103.62     105.41   -1.79   \n",
      "412    20200103  603288.SH  108.50  108.60  104.00  105.41     108.00   -2.59   \n",
      "413    20200102  603288.SH  107.75  109.91  107.58  108.00     107.51    0.49   \n",
      "\n",
      "     pct_chg       vol       amount  \n",
      "276   1.6485  54572.25   798579.731  \n",
      "277   0.8276  77218.48  1141693.510  \n",
      "278   5.7781  72742.60  1037050.820  \n",
      "279  -2.5800  64806.80   896881.888  \n",
      "280   3.5472  82828.48  1156858.738  \n",
      "..       ...       ...          ...  \n",
      "409   0.1604  25883.10   274000.681  \n",
      "410   2.2969  40213.70   423924.757  \n",
      "411  -1.6981  50322.18   524145.305  \n",
      "412  -2.3981  58963.77   623049.159  \n",
      "413   0.4558  40725.22   442407.988  \n",
      "\n",
      "[138 rows x 11 columns]\n",
      "\n"
     ]
    }
   ],
   "source": [
    "df = pd.read_csv('multi_stock_data.csv')\n",
    "grouped = df.groupby('ts_code')\n",
    "#list(grouped)\n",
    "for key, value in grouped:\n",
    "    print(key)\n",
    "    print(value)\n",
    "    print(\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "转换成列表的形式后，可以看到，列表由5个元组组成，每个元组中，第一个元素是组别（这里是按照ts_code进行分组），第二个元素的是对应组别下的DataFrame.\n",
    "总结来说，groupby的过程就是将原有的DataFrame按照groupby的字段（这里是ts_code），划分为若干个分组DataFrame，被分为多少个组就有多少个分组DataFrame。所以说，在groupby之后的一系列操作（如agg、apply等），均是基于子DataFrame的操作。理解了这点，也就基本摸清了Pandas中groupby操作的主要原理。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### agg\n",
    "\n",
    "**聚合操作**是groupby后非常常见的操作。聚合操作可以用来求和、均值、最大值、最小值等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>open</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ts_code</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>002350.SZ</th>\n",
       "      <td>5.705693</td>\n",
       "      <td>5.683650</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002660.SZ</th>\n",
       "      <td>9.363551</td>\n",
       "      <td>9.331304</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002747.SZ</th>\n",
       "      <td>11.567029</td>\n",
       "      <td>11.520072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300685.SZ</th>\n",
       "      <td>75.799058</td>\n",
       "      <td>75.513623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603288.SH</th>\n",
       "      <td>115.442319</td>\n",
       "      <td>114.868841</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                close        open\n",
       "ts_code                          \n",
       "002350.SZ    5.705693    5.683650\n",
       "002660.SZ    9.363551    9.331304\n",
       "002747.SZ   11.567029   11.520072\n",
       "300685.SZ   75.799058   75.513623\n",
       "603288.SH  115.442319  114.868841"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_perform = df.groupby('ts_code')['close','open'].agg('mean')\n",
    "mean_perform"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>open</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ts_code</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>002350.SZ</th>\n",
       "      <td>5.705693</td>\n",
       "      <td>5.660</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002660.SZ</th>\n",
       "      <td>9.363551</td>\n",
       "      <td>9.280</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002747.SZ</th>\n",
       "      <td>11.567029</td>\n",
       "      <td>11.080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300685.SZ</th>\n",
       "      <td>75.799058</td>\n",
       "      <td>73.995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603288.SH</th>\n",
       "      <td>115.442319</td>\n",
       "      <td>113.960</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                close     open\n",
       "ts_code                       \n",
       "002350.SZ    5.705693    5.660\n",
       "002660.SZ    9.363551    9.280\n",
       "002747.SZ   11.567029   11.080\n",
       "300685.SZ   75.799058   73.995\n",
       "603288.SH  115.442319  113.960"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "some_perform = df.groupby('ts_code')['close','open'].agg({'close':'mean', 'open':'median'})\n",
    "some_perform"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### transform\n",
    "对transform而言，则会对每一条数据求得相应的结果，同一组内的样本会有相同的值，组内求完均值后会按照原索引的顺序返回结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>trade_date</th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>avg_close</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20200729</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.88</td>\n",
       "      <td>80.50</td>\n",
       "      <td>75.22</td>\n",
       "      <td>79.53</td>\n",
       "      <td>76.20</td>\n",
       "      <td>3.33</td>\n",
       "      <td>4.3701</td>\n",
       "      <td>48231.39</td>\n",
       "      <td>378538.641</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20200728</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.24</td>\n",
       "      <td>79.43</td>\n",
       "      <td>74.99</td>\n",
       "      <td>76.20</td>\n",
       "      <td>75.37</td>\n",
       "      <td>0.83</td>\n",
       "      <td>1.1012</td>\n",
       "      <td>45510.24</td>\n",
       "      <td>349243.253</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20200727</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.84</td>\n",
       "      <td>75.99</td>\n",
       "      <td>71.09</td>\n",
       "      <td>75.37</td>\n",
       "      <td>70.99</td>\n",
       "      <td>4.38</td>\n",
       "      <td>6.1699</td>\n",
       "      <td>40116.85</td>\n",
       "      <td>298893.827</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20200724</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.56</td>\n",
       "      <td>78.44</td>\n",
       "      <td>70.00</td>\n",
       "      <td>70.99</td>\n",
       "      <td>77.63</td>\n",
       "      <td>-6.64</td>\n",
       "      <td>-8.5534</td>\n",
       "      <td>45608.24</td>\n",
       "      <td>338125.593</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20200723</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.70</td>\n",
       "      <td>80.80</td>\n",
       "      <td>76.41</td>\n",
       "      <td>77.63</td>\n",
       "      <td>76.90</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.9493</td>\n",
       "      <td>46867.92</td>\n",
       "      <td>367416.632</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20200722</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>73.83</td>\n",
       "      <td>77.59</td>\n",
       "      <td>72.92</td>\n",
       "      <td>76.90</td>\n",
       "      <td>73.85</td>\n",
       "      <td>3.05</td>\n",
       "      <td>4.1300</td>\n",
       "      <td>36207.00</td>\n",
       "      <td>275623.622</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>20200721</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.61</td>\n",
       "      <td>74.50</td>\n",
       "      <td>69.50</td>\n",
       "      <td>73.85</td>\n",
       "      <td>70.77</td>\n",
       "      <td>3.08</td>\n",
       "      <td>4.3521</td>\n",
       "      <td>29076.21</td>\n",
       "      <td>212671.328</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>20200720</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.98</td>\n",
       "      <td>71.99</td>\n",
       "      <td>67.18</td>\n",
       "      <td>70.77</td>\n",
       "      <td>70.80</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.0424</td>\n",
       "      <td>34827.97</td>\n",
       "      <td>242427.871</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>20200717</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>69.76</td>\n",
       "      <td>72.13</td>\n",
       "      <td>68.64</td>\n",
       "      <td>70.80</td>\n",
       "      <td>69.37</td>\n",
       "      <td>1.43</td>\n",
       "      <td>2.0614</td>\n",
       "      <td>37857.31</td>\n",
       "      <td>265442.956</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>20200716</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>78.00</td>\n",
       "      <td>78.26</td>\n",
       "      <td>69.36</td>\n",
       "      <td>69.37</td>\n",
       "      <td>77.07</td>\n",
       "      <td>-7.70</td>\n",
       "      <td>-9.9909</td>\n",
       "      <td>51816.84</td>\n",
       "      <td>377971.397</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>20200715</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.60</td>\n",
       "      <td>78.68</td>\n",
       "      <td>75.49</td>\n",
       "      <td>77.07</td>\n",
       "      <td>75.78</td>\n",
       "      <td>1.29</td>\n",
       "      <td>1.7023</td>\n",
       "      <td>37215.87</td>\n",
       "      <td>286581.438</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>20200714</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.73</td>\n",
       "      <td>78.00</td>\n",
       "      <td>73.00</td>\n",
       "      <td>75.78</td>\n",
       "      <td>77.29</td>\n",
       "      <td>-1.51</td>\n",
       "      <td>-1.9537</td>\n",
       "      <td>35784.18</td>\n",
       "      <td>271008.151</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>20200713</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.98</td>\n",
       "      <td>77.35</td>\n",
       "      <td>74.30</td>\n",
       "      <td>77.29</td>\n",
       "      <td>74.10</td>\n",
       "      <td>3.19</td>\n",
       "      <td>4.3050</td>\n",
       "      <td>43903.29</td>\n",
       "      <td>333576.063</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>20200710</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>73.75</td>\n",
       "      <td>75.86</td>\n",
       "      <td>72.90</td>\n",
       "      <td>74.10</td>\n",
       "      <td>73.60</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.6793</td>\n",
       "      <td>46695.92</td>\n",
       "      <td>347164.239</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>20200709</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.10</td>\n",
       "      <td>73.65</td>\n",
       "      <td>70.00</td>\n",
       "      <td>73.60</td>\n",
       "      <td>71.16</td>\n",
       "      <td>2.44</td>\n",
       "      <td>3.4289</td>\n",
       "      <td>54826.16</td>\n",
       "      <td>399887.616</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>20200708</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>72.27</td>\n",
       "      <td>72.74</td>\n",
       "      <td>70.35</td>\n",
       "      <td>71.16</td>\n",
       "      <td>72.09</td>\n",
       "      <td>-0.93</td>\n",
       "      <td>-1.2901</td>\n",
       "      <td>34518.84</td>\n",
       "      <td>246140.556</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>20200707</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.00</td>\n",
       "      <td>73.43</td>\n",
       "      <td>68.70</td>\n",
       "      <td>72.09</td>\n",
       "      <td>71.10</td>\n",
       "      <td>0.99</td>\n",
       "      <td>1.3924</td>\n",
       "      <td>59030.63</td>\n",
       "      <td>423139.793</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>20200706</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.02</td>\n",
       "      <td>71.79</td>\n",
       "      <td>68.88</td>\n",
       "      <td>71.10</td>\n",
       "      <td>71.78</td>\n",
       "      <td>-0.68</td>\n",
       "      <td>-0.9473</td>\n",
       "      <td>49749.56</td>\n",
       "      <td>351523.864</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>20200703</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>72.50</td>\n",
       "      <td>73.10</td>\n",
       "      <td>70.00</td>\n",
       "      <td>71.78</td>\n",
       "      <td>71.79</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.0139</td>\n",
       "      <td>44320.35</td>\n",
       "      <td>317241.463</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20200702</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.13</td>\n",
       "      <td>75.97</td>\n",
       "      <td>71.25</td>\n",
       "      <td>71.79</td>\n",
       "      <td>75.00</td>\n",
       "      <td>-3.21</td>\n",
       "      <td>-4.2800</td>\n",
       "      <td>49920.29</td>\n",
       "      <td>363465.213</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>20200701</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>77.12</td>\n",
       "      <td>78.26</td>\n",
       "      <td>72.39</td>\n",
       "      <td>75.00</td>\n",
       "      <td>76.96</td>\n",
       "      <td>-1.96</td>\n",
       "      <td>-2.5468</td>\n",
       "      <td>47894.86</td>\n",
       "      <td>358618.948</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>20200630</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.30</td>\n",
       "      <td>79.95</td>\n",
       "      <td>75.58</td>\n",
       "      <td>76.96</td>\n",
       "      <td>76.52</td>\n",
       "      <td>0.44</td>\n",
       "      <td>0.5750</td>\n",
       "      <td>40548.34</td>\n",
       "      <td>315525.626</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>20200629</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.90</td>\n",
       "      <td>77.39</td>\n",
       "      <td>70.33</td>\n",
       "      <td>76.52</td>\n",
       "      <td>71.39</td>\n",
       "      <td>5.13</td>\n",
       "      <td>7.1859</td>\n",
       "      <td>47526.42</td>\n",
       "      <td>354810.200</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>20200624</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.10</td>\n",
       "      <td>71.91</td>\n",
       "      <td>69.80</td>\n",
       "      <td>71.39</td>\n",
       "      <td>71.20</td>\n",
       "      <td>0.19</td>\n",
       "      <td>0.2669</td>\n",
       "      <td>40287.73</td>\n",
       "      <td>286346.167</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>20200623</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>68.28</td>\n",
       "      <td>71.80</td>\n",
       "      <td>68.28</td>\n",
       "      <td>71.20</td>\n",
       "      <td>67.00</td>\n",
       "      <td>4.20</td>\n",
       "      <td>6.2687</td>\n",
       "      <td>57229.92</td>\n",
       "      <td>404187.925</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>20200622</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>66.91</td>\n",
       "      <td>68.40</td>\n",
       "      <td>66.01</td>\n",
       "      <td>67.00</td>\n",
       "      <td>66.96</td>\n",
       "      <td>0.04</td>\n",
       "      <td>0.0597</td>\n",
       "      <td>39436.54</td>\n",
       "      <td>264723.283</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>20200619</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>65.37</td>\n",
       "      <td>67.45</td>\n",
       "      <td>64.30</td>\n",
       "      <td>66.96</td>\n",
       "      <td>64.24</td>\n",
       "      <td>2.72</td>\n",
       "      <td>4.2341</td>\n",
       "      <td>43957.20</td>\n",
       "      <td>292223.754</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>20200618</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>66.99</td>\n",
       "      <td>67.66</td>\n",
       "      <td>63.72</td>\n",
       "      <td>64.24</td>\n",
       "      <td>67.41</td>\n",
       "      <td>-3.17</td>\n",
       "      <td>-4.7026</td>\n",
       "      <td>48086.17</td>\n",
       "      <td>312153.061</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>20200617</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>67.00</td>\n",
       "      <td>69.19</td>\n",
       "      <td>66.23</td>\n",
       "      <td>67.41</td>\n",
       "      <td>66.58</td>\n",
       "      <td>0.83</td>\n",
       "      <td>1.2466</td>\n",
       "      <td>55550.50</td>\n",
       "      <td>376356.761</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>20200616</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>63.63</td>\n",
       "      <td>67.79</td>\n",
       "      <td>62.28</td>\n",
       "      <td>66.58</td>\n",
       "      <td>63.15</td>\n",
       "      <td>3.43</td>\n",
       "      <td>5.4315</td>\n",
       "      <td>62299.90</td>\n",
       "      <td>409306.837</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>659</th>\n",
       "      <td>20200220</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.07</td>\n",
       "      <td>6.23</td>\n",
       "      <td>5.94</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.08</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.9737</td>\n",
       "      <td>136050.11</td>\n",
       "      <td>83301.161</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>660</th>\n",
       "      <td>20200219</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.23</td>\n",
       "      <td>6.26</td>\n",
       "      <td>6.04</td>\n",
       "      <td>6.08</td>\n",
       "      <td>6.28</td>\n",
       "      <td>-0.20</td>\n",
       "      <td>-3.1847</td>\n",
       "      <td>126933.50</td>\n",
       "      <td>78189.836</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>661</th>\n",
       "      <td>20200218</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.39</td>\n",
       "      <td>6.06</td>\n",
       "      <td>6.28</td>\n",
       "      <td>6.16</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.9481</td>\n",
       "      <td>174172.50</td>\n",
       "      <td>108591.280</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>662</th>\n",
       "      <td>20200217</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.00</td>\n",
       "      <td>6.17</td>\n",
       "      <td>5.95</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.06</td>\n",
       "      <td>0.10</td>\n",
       "      <td>1.6502</td>\n",
       "      <td>126684.60</td>\n",
       "      <td>76711.019</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>20200214</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.79</td>\n",
       "      <td>6.19</td>\n",
       "      <td>5.71</td>\n",
       "      <td>6.06</td>\n",
       "      <td>5.99</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.1686</td>\n",
       "      <td>160717.53</td>\n",
       "      <td>95509.993</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>20200213</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.44</td>\n",
       "      <td>5.99</td>\n",
       "      <td>5.99</td>\n",
       "      <td>5.92</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.1824</td>\n",
       "      <td>280371.90</td>\n",
       "      <td>173459.234</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>20200212</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.46</td>\n",
       "      <td>5.92</td>\n",
       "      <td>5.45</td>\n",
       "      <td>5.92</td>\n",
       "      <td>5.38</td>\n",
       "      <td>0.54</td>\n",
       "      <td>10.0372</td>\n",
       "      <td>155563.45</td>\n",
       "      <td>89984.065</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>20200211</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.49</td>\n",
       "      <td>5.37</td>\n",
       "      <td>5.38</td>\n",
       "      <td>5.47</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-1.6453</td>\n",
       "      <td>39459.27</td>\n",
       "      <td>21350.565</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>20200210</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.32</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.27</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.32</td>\n",
       "      <td>0.15</td>\n",
       "      <td>2.8195</td>\n",
       "      <td>46564.08</td>\n",
       "      <td>25228.387</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>668</th>\n",
       "      <td>20200207</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.19</td>\n",
       "      <td>5.34</td>\n",
       "      <td>5.13</td>\n",
       "      <td>5.32</td>\n",
       "      <td>5.19</td>\n",
       "      <td>0.13</td>\n",
       "      <td>2.5048</td>\n",
       "      <td>53671.38</td>\n",
       "      <td>28235.062</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>669</th>\n",
       "      <td>20200206</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.11</td>\n",
       "      <td>5.22</td>\n",
       "      <td>5.10</td>\n",
       "      <td>5.19</td>\n",
       "      <td>5.14</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.9728</td>\n",
       "      <td>50352.95</td>\n",
       "      <td>26031.271</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>670</th>\n",
       "      <td>20200205</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.23</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.14</td>\n",
       "      <td>5.08</td>\n",
       "      <td>0.06</td>\n",
       "      <td>1.1811</td>\n",
       "      <td>47655.51</td>\n",
       "      <td>24578.871</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>671</th>\n",
       "      <td>20200204</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>4.72</td>\n",
       "      <td>5.23</td>\n",
       "      <td>4.72</td>\n",
       "      <td>5.08</td>\n",
       "      <td>5.24</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-3.0534</td>\n",
       "      <td>77073.61</td>\n",
       "      <td>38838.267</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>672</th>\n",
       "      <td>20200203</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.82</td>\n",
       "      <td>-0.58</td>\n",
       "      <td>-9.9656</td>\n",
       "      <td>11901.00</td>\n",
       "      <td>6236.124</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>673</th>\n",
       "      <td>20200123</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.98</td>\n",
       "      <td>6.02</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.82</td>\n",
       "      <td>5.99</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.8381</td>\n",
       "      <td>48644.92</td>\n",
       "      <td>28534.580</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>674</th>\n",
       "      <td>20200122</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.92</td>\n",
       "      <td>6.07</td>\n",
       "      <td>5.83</td>\n",
       "      <td>5.99</td>\n",
       "      <td>6.00</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.1667</td>\n",
       "      <td>48130.38</td>\n",
       "      <td>28812.409</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>675</th>\n",
       "      <td>20200121</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.17</td>\n",
       "      <td>5.96</td>\n",
       "      <td>6.00</td>\n",
       "      <td>6.15</td>\n",
       "      <td>-0.15</td>\n",
       "      <td>-2.4390</td>\n",
       "      <td>57842.42</td>\n",
       "      <td>34871.239</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>676</th>\n",
       "      <td>20200120</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.08</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.05</td>\n",
       "      <td>6.15</td>\n",
       "      <td>6.10</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.8197</td>\n",
       "      <td>49417.89</td>\n",
       "      <td>30162.397</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>677</th>\n",
       "      <td>20200117</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.14</td>\n",
       "      <td>6.22</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.19</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-1.4540</td>\n",
       "      <td>59659.40</td>\n",
       "      <td>36665.953</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>678</th>\n",
       "      <td>20200116</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.34</td>\n",
       "      <td>6.34</td>\n",
       "      <td>6.19</td>\n",
       "      <td>6.19</td>\n",
       "      <td>6.36</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.6730</td>\n",
       "      <td>78552.90</td>\n",
       "      <td>48990.967</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>679</th>\n",
       "      <td>20200115</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.55</td>\n",
       "      <td>6.60</td>\n",
       "      <td>6.25</td>\n",
       "      <td>6.36</td>\n",
       "      <td>6.59</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-3.4901</td>\n",
       "      <td>148040.02</td>\n",
       "      <td>93985.570</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>680</th>\n",
       "      <td>20200114</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.48</td>\n",
       "      <td>6.92</td>\n",
       "      <td>6.45</td>\n",
       "      <td>6.59</td>\n",
       "      <td>6.54</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.7645</td>\n",
       "      <td>211606.87</td>\n",
       "      <td>141252.242</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>681</th>\n",
       "      <td>20200113</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.50</td>\n",
       "      <td>6.62</td>\n",
       "      <td>6.41</td>\n",
       "      <td>6.54</td>\n",
       "      <td>6.71</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.5335</td>\n",
       "      <td>260810.94</td>\n",
       "      <td>169894.614</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>682</th>\n",
       "      <td>20200110</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.05</td>\n",
       "      <td>6.71</td>\n",
       "      <td>5.97</td>\n",
       "      <td>6.71</td>\n",
       "      <td>6.10</td>\n",
       "      <td>0.61</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>332168.68</td>\n",
       "      <td>215221.161</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>683</th>\n",
       "      <td>20200109</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.28</td>\n",
       "      <td>6.37</td>\n",
       "      <td>5.92</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.05</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.8264</td>\n",
       "      <td>140280.25</td>\n",
       "      <td>85630.713</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>684</th>\n",
       "      <td>20200108</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.52</td>\n",
       "      <td>6.01</td>\n",
       "      <td>6.05</td>\n",
       "      <td>5.93</td>\n",
       "      <td>0.12</td>\n",
       "      <td>2.0236</td>\n",
       "      <td>182015.88</td>\n",
       "      <td>111934.573</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>685</th>\n",
       "      <td>20200107</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.75</td>\n",
       "      <td>6.07</td>\n",
       "      <td>5.75</td>\n",
       "      <td>5.93</td>\n",
       "      <td>5.72</td>\n",
       "      <td>0.21</td>\n",
       "      <td>3.6713</td>\n",
       "      <td>101464.57</td>\n",
       "      <td>59886.982</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>686</th>\n",
       "      <td>20200106</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.72</td>\n",
       "      <td>5.69</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.5272</td>\n",
       "      <td>28396.10</td>\n",
       "      <td>16216.815</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>687</th>\n",
       "      <td>20200103</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.66</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.69</td>\n",
       "      <td>5.67</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.3527</td>\n",
       "      <td>23224.10</td>\n",
       "      <td>13208.640</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688</th>\n",
       "      <td>20200102</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.68</td>\n",
       "      <td>5.60</td>\n",
       "      <td>5.67</td>\n",
       "      <td>5.60</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.2500</td>\n",
       "      <td>30157.31</td>\n",
       "      <td>17036.562</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>689 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
       "0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
       "1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
       "2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
       "3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
       "4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
       "5      20200722  300685.SZ  73.83  77.59  72.92  76.90      73.85    3.05   \n",
       "6      20200721  300685.SZ  70.61  74.50  69.50  73.85      70.77    3.08   \n",
       "7      20200720  300685.SZ  71.98  71.99  67.18  70.77      70.80   -0.03   \n",
       "8      20200717  300685.SZ  69.76  72.13  68.64  70.80      69.37    1.43   \n",
       "9      20200716  300685.SZ  78.00  78.26  69.36  69.37      77.07   -7.70   \n",
       "10     20200715  300685.SZ  75.60  78.68  75.49  77.07      75.78    1.29   \n",
       "11     20200714  300685.SZ  76.73  78.00  73.00  75.78      77.29   -1.51   \n",
       "12     20200713  300685.SZ  75.98  77.35  74.30  77.29      74.10    3.19   \n",
       "13     20200710  300685.SZ  73.75  75.86  72.90  74.10      73.60    0.50   \n",
       "14     20200709  300685.SZ  71.10  73.65  70.00  73.60      71.16    2.44   \n",
       "15     20200708  300685.SZ  72.27  72.74  70.35  71.16      72.09   -0.93   \n",
       "16     20200707  300685.SZ  70.00  73.43  68.70  72.09      71.10    0.99   \n",
       "17     20200706  300685.SZ  71.02  71.79  68.88  71.10      71.78   -0.68   \n",
       "18     20200703  300685.SZ  72.50  73.10  70.00  71.78      71.79   -0.01   \n",
       "19     20200702  300685.SZ  75.13  75.97  71.25  71.79      75.00   -3.21   \n",
       "20     20200701  300685.SZ  77.12  78.26  72.39  75.00      76.96   -1.96   \n",
       "21     20200630  300685.SZ  76.30  79.95  75.58  76.96      76.52    0.44   \n",
       "22     20200629  300685.SZ  70.90  77.39  70.33  76.52      71.39    5.13   \n",
       "23     20200624  300685.SZ  71.10  71.91  69.80  71.39      71.20    0.19   \n",
       "24     20200623  300685.SZ  68.28  71.80  68.28  71.20      67.00    4.20   \n",
       "25     20200622  300685.SZ  66.91  68.40  66.01  67.00      66.96    0.04   \n",
       "26     20200619  300685.SZ  65.37  67.45  64.30  66.96      64.24    2.72   \n",
       "27     20200618  300685.SZ  66.99  67.66  63.72  64.24      67.41   -3.17   \n",
       "28     20200617  300685.SZ  67.00  69.19  66.23  67.41      66.58    0.83   \n",
       "29     20200616  300685.SZ  63.63  67.79  62.28  66.58      63.15    3.43   \n",
       "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
       "659    20200220  002350.SZ   6.07   6.23   5.94   6.20       6.08    0.12   \n",
       "660    20200219  002350.SZ   6.23   6.26   6.04   6.08       6.28   -0.20   \n",
       "661    20200218  002350.SZ   6.10   6.39   6.06   6.28       6.16    0.12   \n",
       "662    20200217  002350.SZ   6.00   6.17   5.95   6.16       6.06    0.10   \n",
       "663    20200214  002350.SZ   5.79   6.19   5.71   6.06       5.99    0.07   \n",
       "664    20200213  002350.SZ   6.20   6.44   5.99   5.99       5.92    0.07   \n",
       "665    20200212  002350.SZ   5.46   5.92   5.45   5.92       5.38    0.54   \n",
       "666    20200211  002350.SZ   5.47   5.49   5.37   5.38       5.47   -0.09   \n",
       "667    20200210  002350.SZ   5.32   5.47   5.27   5.47       5.32    0.15   \n",
       "668    20200207  002350.SZ   5.19   5.34   5.13   5.32       5.19    0.13   \n",
       "669    20200206  002350.SZ   5.11   5.22   5.10   5.19       5.14    0.05   \n",
       "670    20200205  002350.SZ   5.09   5.23   5.09   5.14       5.08    0.06   \n",
       "671    20200204  002350.SZ   4.72   5.23   4.72   5.08       5.24   -0.16   \n",
       "672    20200203  002350.SZ   5.24   5.24   5.24   5.24       5.82   -0.58   \n",
       "673    20200123  002350.SZ   5.98   6.02   5.74   5.82       5.99   -0.17   \n",
       "674    20200122  002350.SZ   5.92   6.07   5.83   5.99       6.00   -0.01   \n",
       "675    20200121  002350.SZ   6.16   6.17   5.96   6.00       6.15   -0.15   \n",
       "676    20200120  002350.SZ   6.08   6.16   6.05   6.15       6.10    0.05   \n",
       "677    20200117  002350.SZ   6.14   6.22   6.10   6.10       6.19   -0.09   \n",
       "678    20200116  002350.SZ   6.34   6.34   6.19   6.19       6.36   -0.17   \n",
       "679    20200115  002350.SZ   6.55   6.60   6.25   6.36       6.59   -0.23   \n",
       "680    20200114  002350.SZ   6.48   6.92   6.45   6.59       6.54    0.05   \n",
       "681    20200113  002350.SZ   6.50   6.62   6.41   6.54       6.71   -0.17   \n",
       "682    20200110  002350.SZ   6.05   6.71   5.97   6.71       6.10    0.61   \n",
       "683    20200109  002350.SZ   6.28   6.37   5.92   6.10       6.05    0.05   \n",
       "684    20200108  002350.SZ   6.20   6.52   6.01   6.05       5.93    0.12   \n",
       "685    20200107  002350.SZ   5.75   6.07   5.75   5.93       5.72    0.21   \n",
       "686    20200106  002350.SZ   5.65   5.74   5.65   5.72       5.69    0.03   \n",
       "687    20200103  002350.SZ   5.66   5.74   5.65   5.69       5.67    0.02   \n",
       "688    20200102  002350.SZ   5.65   5.68   5.60   5.67       5.60    0.07   \n",
       "\n",
       "     pct_chg        vol      amount  avg_close  \n",
       "0     4.3701   48231.39  378538.641  75.799058  \n",
       "1     1.1012   45510.24  349243.253  75.799058  \n",
       "2     6.1699   40116.85  298893.827  75.799058  \n",
       "3    -8.5534   45608.24  338125.593  75.799058  \n",
       "4     0.9493   46867.92  367416.632  75.799058  \n",
       "5     4.1300   36207.00  275623.622  75.799058  \n",
       "6     4.3521   29076.21  212671.328  75.799058  \n",
       "7    -0.0424   34827.97  242427.871  75.799058  \n",
       "8     2.0614   37857.31  265442.956  75.799058  \n",
       "9    -9.9909   51816.84  377971.397  75.799058  \n",
       "10    1.7023   37215.87  286581.438  75.799058  \n",
       "11   -1.9537   35784.18  271008.151  75.799058  \n",
       "12    4.3050   43903.29  333576.063  75.799058  \n",
       "13    0.6793   46695.92  347164.239  75.799058  \n",
       "14    3.4289   54826.16  399887.616  75.799058  \n",
       "15   -1.2901   34518.84  246140.556  75.799058  \n",
       "16    1.3924   59030.63  423139.793  75.799058  \n",
       "17   -0.9473   49749.56  351523.864  75.799058  \n",
       "18   -0.0139   44320.35  317241.463  75.799058  \n",
       "19   -4.2800   49920.29  363465.213  75.799058  \n",
       "20   -2.5468   47894.86  358618.948  75.799058  \n",
       "21    0.5750   40548.34  315525.626  75.799058  \n",
       "22    7.1859   47526.42  354810.200  75.799058  \n",
       "23    0.2669   40287.73  286346.167  75.799058  \n",
       "24    6.2687   57229.92  404187.925  75.799058  \n",
       "25    0.0597   39436.54  264723.283  75.799058  \n",
       "26    4.2341   43957.20  292223.754  75.799058  \n",
       "27   -4.7026   48086.17  312153.061  75.799058  \n",
       "28    1.2466   55550.50  376356.761  75.799058  \n",
       "29    5.4315   62299.90  409306.837  75.799058  \n",
       "..       ...        ...         ...        ...  \n",
       "659   1.9737  136050.11   83301.161   5.705693  \n",
       "660  -3.1847  126933.50   78189.836   5.705693  \n",
       "661   1.9481  174172.50  108591.280   5.705693  \n",
       "662   1.6502  126684.60   76711.019   5.705693  \n",
       "663   1.1686  160717.53   95509.993   5.705693  \n",
       "664   1.1824  280371.90  173459.234   5.705693  \n",
       "665  10.0372  155563.45   89984.065   5.705693  \n",
       "666  -1.6453   39459.27   21350.565   5.705693  \n",
       "667   2.8195   46564.08   25228.387   5.705693  \n",
       "668   2.5048   53671.38   28235.062   5.705693  \n",
       "669   0.9728   50352.95   26031.271   5.705693  \n",
       "670   1.1811   47655.51   24578.871   5.705693  \n",
       "671  -3.0534   77073.61   38838.267   5.705693  \n",
       "672  -9.9656   11901.00    6236.124   5.705693  \n",
       "673  -2.8381   48644.92   28534.580   5.705693  \n",
       "674  -0.1667   48130.38   28812.409   5.705693  \n",
       "675  -2.4390   57842.42   34871.239   5.705693  \n",
       "676   0.8197   49417.89   30162.397   5.705693  \n",
       "677  -1.4540   59659.40   36665.953   5.705693  \n",
       "678  -2.6730   78552.90   48990.967   5.705693  \n",
       "679  -3.4901  148040.02   93985.570   5.705693  \n",
       "680   0.7645  211606.87  141252.242   5.705693  \n",
       "681  -2.5335  260810.94  169894.614   5.705693  \n",
       "682  10.0000  332168.68  215221.161   5.705693  \n",
       "683   0.8264  140280.25   85630.713   5.705693  \n",
       "684   2.0236  182015.88  111934.573   5.705693  \n",
       "685   3.6713  101464.57   59886.982   5.705693  \n",
       "686   0.5272   28396.10   16216.815   5.705693  \n",
       "687   0.3527   23224.10   13208.640   5.705693  \n",
       "688   1.2500   30157.31   17036.562   5.705693  \n",
       "\n",
       "[689 rows x 12 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_trans = df\n",
    "df_trans['avg_close'] = df_trans.groupby('ts_code')['close'].transform('mean')\n",
    "df_trans"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 场景一\n",
    "\n",
    "我们拿到了一个数据集multi_stock_data.csv，里面包含着5个股票在2020年一段时间的日价格数据，我们想知道每个股票的最大涨幅（pct_chg）各自是多少？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ts_code\n",
       "002350.SZ    10.0372\n",
       "002660.SZ     9.9886\n",
       "002747.SZ    10.0402\n",
       "300685.SZ     7.1859\n",
       "603288.SH    10.0009\n",
       "Name: pct_chg, dtype: float64"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('multi_stock_data.csv')\n",
    "best_perform = df.groupby('ts_code')['pct_chg'].apply(max)\n",
    "best_perform"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 场景二\n",
    "\n",
    "我们拿到了5个股票在2020年一段时间的日价格数据，我们想知道每个股票的第二大交易发生在什么时间？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>8886.508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002660.SZ</td>\n",
       "      <td>31304.942</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>42285.525</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>50858.522</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>603288.SH</td>\n",
       "      <td>239519.343</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     ts_code      amount\n",
       "0  002350.SZ    8886.508\n",
       "1  002660.SZ   31304.942\n",
       "2  002747.SZ   42285.525\n",
       "3  300685.SZ   50858.522\n",
       "4  603288.SH  239519.343"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_second_largest(x):\n",
    "    return x.iloc[1,:]\n",
    "\n",
    "df_tmp = df.sort_values(by = ['ts_code', 'amount'], ascending = [True, True])\n",
    "#df_tmp\n",
    "df_new = df_tmp.groupby('ts_code')[['amount']].apply(get_second_largest).reset_index()\n",
    "df_new\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 作业\n",
    "\n",
    "1. 了解如何使用下列的函数：去重（df.drop_duplicates）, 去空值（df.dropna），合并（df.merge, dr.concat），分组（df.groupby）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>trade_date</th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20200729</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.88</td>\n",
       "      <td>80.50</td>\n",
       "      <td>75.22</td>\n",
       "      <td>79.53</td>\n",
       "      <td>76.20</td>\n",
       "      <td>3.33</td>\n",
       "      <td>4.3701</td>\n",
       "      <td>48231.39</td>\n",
       "      <td>378538.641</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20200728</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.24</td>\n",
       "      <td>79.43</td>\n",
       "      <td>74.99</td>\n",
       "      <td>76.20</td>\n",
       "      <td>75.37</td>\n",
       "      <td>0.83</td>\n",
       "      <td>1.1012</td>\n",
       "      <td>45510.24</td>\n",
       "      <td>349243.253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20200727</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.84</td>\n",
       "      <td>75.99</td>\n",
       "      <td>71.09</td>\n",
       "      <td>75.37</td>\n",
       "      <td>70.99</td>\n",
       "      <td>4.38</td>\n",
       "      <td>6.1699</td>\n",
       "      <td>40116.85</td>\n",
       "      <td>298893.827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20200724</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.56</td>\n",
       "      <td>78.44</td>\n",
       "      <td>70.00</td>\n",
       "      <td>70.99</td>\n",
       "      <td>77.63</td>\n",
       "      <td>-6.64</td>\n",
       "      <td>-8.5534</td>\n",
       "      <td>45608.24</td>\n",
       "      <td>338125.593</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20200723</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.70</td>\n",
       "      <td>80.80</td>\n",
       "      <td>76.41</td>\n",
       "      <td>77.63</td>\n",
       "      <td>76.90</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.9493</td>\n",
       "      <td>46867.92</td>\n",
       "      <td>367416.632</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>684</th>\n",
       "      <td>20200108</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.52</td>\n",
       "      <td>6.01</td>\n",
       "      <td>6.05</td>\n",
       "      <td>5.93</td>\n",
       "      <td>0.12</td>\n",
       "      <td>2.0236</td>\n",
       "      <td>182015.88</td>\n",
       "      <td>111934.573</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>685</th>\n",
       "      <td>20200107</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.75</td>\n",
       "      <td>6.07</td>\n",
       "      <td>5.75</td>\n",
       "      <td>5.93</td>\n",
       "      <td>5.72</td>\n",
       "      <td>0.21</td>\n",
       "      <td>3.6713</td>\n",
       "      <td>101464.57</td>\n",
       "      <td>59886.982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>686</th>\n",
       "      <td>20200106</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.72</td>\n",
       "      <td>5.69</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.5272</td>\n",
       "      <td>28396.10</td>\n",
       "      <td>16216.815</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>687</th>\n",
       "      <td>20200103</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.66</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.69</td>\n",
       "      <td>5.67</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.3527</td>\n",
       "      <td>23224.10</td>\n",
       "      <td>13208.640</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688</th>\n",
       "      <td>20200102</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.68</td>\n",
       "      <td>5.60</td>\n",
       "      <td>5.67</td>\n",
       "      <td>5.60</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.2500</td>\n",
       "      <td>30157.31</td>\n",
       "      <td>17036.562</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>689 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
       "0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
       "1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
       "2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
       "3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
       "4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
       "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
       "684    20200108  002350.SZ   6.20   6.52   6.01   6.05       5.93    0.12   \n",
       "685    20200107  002350.SZ   5.75   6.07   5.75   5.93       5.72    0.21   \n",
       "686    20200106  002350.SZ   5.65   5.74   5.65   5.72       5.69    0.03   \n",
       "687    20200103  002350.SZ   5.66   5.74   5.65   5.69       5.67    0.02   \n",
       "688    20200102  002350.SZ   5.65   5.68   5.60   5.67       5.60    0.07   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "0     4.3701   48231.39  378538.641  \n",
       "1     1.1012   45510.24  349243.253  \n",
       "2     6.1699   40116.85  298893.827  \n",
       "3    -8.5534   45608.24  338125.593  \n",
       "4     0.9493   46867.92  367416.632  \n",
       "..       ...        ...         ...  \n",
       "684   2.0236  182015.88  111934.573  \n",
       "685   3.6713  101464.57   59886.982  \n",
       "686   0.5272   28396.10   16216.815  \n",
       "687   0.3527   23224.10   13208.640  \n",
       "688   1.2500   30157.31   17036.562  \n",
       "\n",
       "[689 rows x 11 columns]"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAABCnElEQVR4nO29d5icZ3nv/3mm7ZTtvUmrYhVLtrpt2djCxoUWsANOYhKKITkOJXDgnB8JJKSck5OEEK4UcGKHEh8nkAOJwYaAAYONkY0t25Ksbqu3Xa1W28v08vz+eN93dnZ3Zndmd2Zndvf+XJcu7b7zzsyj0bzfuef73EVprREEQRAWPrZiL0AQBEHIDyLogiAIiwQRdEEQhEWCCLogCMIiQQRdEARhkeAo1hPX19frFStWFOvpBUEQFiT79u3r01o3pLutaIK+YsUK9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spP3baNSul/giIAd8szvLSkm7Nfwb8IfAnRVxXJjK9xqV87WVacylffxNY9IKute4y/74CPI7xNa4T+K75VellIIHRdKcLw4+0aDePFXu9HwC+a57yn4x/FS36ejFey06t9Uvm749hXBQ91tdP82/rq3Uprxml1P3ArwC/ZX4QQWmveSVwUCl1zlzXfqVUM8Vfc6b1luy1R+Y1l/L1N4FFLejmV9IK62eMTa8jwBMYmzMopdZibH70Ad8H7lNKlSmlVgJrgJdLYL2XgDeap70JOGn+/H3g/eZu+05gOMXmmBe01peBi0qpdeah24Fj5to+YB77APC9Ul+zUuotGF70O7XWgZS7FPV9Mc2a92utG7XWK7TWKzAEaZt5blFf52neF09QgtfeDGsu2etvCsXelS3kH2AVxs75QeAo8Ed6fPf6GxhiuR94U8p9/ghjh/045s52Caz3ZmCfefwlYLt5XAH/aK73MLCjSK/zFmAvcAjjgq0B6oCnMd78PwNqF8CaT2F4ogfMPw+XwvtiujVPuv0c41kuRX+dM7zGJXntzbDmkr7+Uv9I6b8gCMIiYVFbLoIgCEsJEXRBEIRFggi6IAjCIkEEXRAEYZEggi4IgrBIEEEXBEFYJIigC4IgLBL+f5+lIwPqzA1GAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "df[df['ts_code'] == '002350.SZ']['close'].plot(y = 'close')\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
